<?php

namespace apiend\models\searchs;

use yii\helpers\Inflector;

/**
 * 基础面板数据模型
 *
 * @author emhome <emhome@163.com>
 * @since 1.0
 */
class DashboardSearch extends \common\base\Model {

    /**
     * @inheritdoc
     */
    public function fields() {
        $attributes = $this->attributes;
        foreach ($attributes as $key => $vls) {
            $method = 'set' . Inflector::camelize($key);
            $handler = array($this, $method);
            if ($this->hasMethod($method) && is_callable($handler)) {
                $this->$key = call_user_func_array($handler, [$vls]);
            }
        }
        return parent::fields();
    }

}
